package com.bokee.archerwq.lab.collection;

import java.util.HashSet;
import java.util.LinkedHashSet;
import java.util.Random;
import java.util.Set;
import java.util.TreeSet;

public class TestSet {

	private static void fill(Set<Integer> set) {
		Random rand = new Random();
		for (int i = 0; i < 10; i++) {
			int value = rand.nextInt() % 10;
			set.add(value);
			System.out.println(value);
		}
	}

	public static void main(String[] args) {
		Set<Integer> set1 = new HashSet<Integer>();
		Set<Integer> set2 = new TreeSet<Integer>();
		Set<Integer> set3 = new LinkedHashSet<Integer>();
		fill(set1);
		System.out.println("set1: " + set1);
		fill(set2);
		System.out.println("set2: " + set2);
		fill(set3);
		System.out.println("set3: " + set3);
	}

}
